/*    *//*
 package com.gillion.grule.client.components;
*/
/*    *//*

*/
/*    *//*
 import com.alibaba.fastjson.JSON;
*/
/*    *//*
 import com.alibaba.fastjson.JSONArray;
*/
/*    *//*
 import com.alibaba.fastjson.JSONObject;
*/
/*    *//*
 import com.gillion.grule.client.core.Component;
*/
/*    *//*
 import com.gillion.grule.client.core.Context;
*/
/*    *//*
 import com.gillion.grule.client.core.ExecuteComponent;
*/
/*    *//*
 import com.gillion.grule.client.core.RemoteConfig;
*/
/*    *//*
 import com.google.common.collect.Lists;
*/
/*    *//*
 import java.util.List;
*/
/*    *//*
 import org.mvel2.MVEL;
*/
/*    *//*
 import org.slf4j.Logger;
*/
/*    *//*
 import org.slf4j.LoggerFactory;
*/
/*    *//*

*/
/*    *//*

*/
/*    *//*
 @Component("RemoteService")
*/
/*    *//*
 public class RemoteServiceComponent
*/
/*    *//*
   extends ExecuteComponent
*/
/*    *//*
 {
*/
/* 23 *//*
   private static final Logger LOGGER = LoggerFactory.getLogger(JDBCComponent.class);
*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*
   public <T> T execute(String express, Context context) {
*/
/* 28 *//*
     JSONObject jSONObject1 = JSON.parseObject(express);
*/
/* 29 *//*
     String serverName = jSONObject1.get("serviceName").toString();
*/
/* 30 *//*
     List<String> expressParams = (List<String>)jSONObject1.get("params");
*/
/* 31 *//*
     List<Object> params = Lists.newArrayList();
*/
/* 32 *//*
     List<RemoteConfig> list = context.getRemoteConfig();
*/
/* 33 *//*
     RemoteConfig config = new RemoteConfig();
*/
/*    *//*

*/
/* 35 *//*
     for (RemoteConfig remoteConfig : list) {
*/
/* 36 *//*
       if (remoteConfig.getRemoteName().equals(serverName)) {
*/
/* 37 *//*
         config = remoteConfig;
*/
/*    *//*
       }
*/
/*    *//*
     }
*/
/* 40 *//*
     String requestStr = config.getRemoteConfig();
*/
/*    *//*

*/
/* 42 *//*
     JSONArray jSONArray = JSON.parseArray(config.getRemoteParams()); int i;
*/
/* 43 *//*
     for (i = 0; i < expressParams.size(); i++) {
*/
/* 44 *//*
       Object obj = expressParams.get(i);
*/
/* 45 *//*
       if (obj instanceof String) {
*/
/*    *//*
         try {
*/
/* 47 *//*
           params.add(MVEL.eval(expressParams.get(i), context).toString());
*/
/* 48 *//*
         } catch (Exception e) {
*/
/* 49 *//*
           params.add(MVEL.eval("'" + (String)expressParams.get(i) + "'", context).toString());
*/
/*    *//*
         }
*/
/*    *//*
       } else {
*/
/* 52 *//*
         params.add(expressParams.get(i));
*/
/*    *//*
       }
*/
/*    *//*
     }
*/
/*    *//*

*/
/*    *//*

*/
/* 57 *//*
     for (i = 0; i < jSONArray.size(); i++) {
*/
/* 58 *//*
       if (params.size() > i && params.get(i) != null) {
*/
/* 59 *//*
         requestStr = requestStr.replaceAll("#\\{" + (String)jSONArray.get(i) + "\\}", params.get(i).toString());
*/
/*    *//*
       } else {
*/
/* 61 *//*
         requestStr = requestStr.replaceAll("'#\\{" + (String)jSONArray.get(i) + "\\}'", "null");
*/
/*    *//*
       }
*/
/*    *//*
     }
*/
/*    *//*

*/
/* 65 *//*
     JSONObject jSONObject2 = JSON.parseObject(requestStr);
*/
/* 66 *//*
     LOGGER.info("发起远程服务请求,请求编码：{},请求报文：{}", config.getRemoteCode(), jSONObject2);
*/
/* 67 *//*
     //Response response = SdkRegistry.getInstance().getEdsClient().request(config.getRemoteCode(), jSONObject2);
*/
/* 68 *//*
     LOGGER.info("eds远程服务返回值为：{}", response.getBody());
*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/*    *//*

*/
/* 74 *//*
     JSONObject jSONObject3 = JSON.parseObject(config.getRemoteResult());
*/
/* 75 *//*
     if (jSONObject3 != null && jSONObject3.get("returnName") != null) {
*/
/* 76 *//*
       return (T)MVEL.eval((String)jSONObject3.get("returnName"), response.getBody());
*/
/*    *//*
     }
*/
/* 78 *//*
     return (T)response.getBody();
*/
/*    *//*
   }
*/
/*    *//*
 }


*/
/* Location:              D:\apache-tomcat-9.0.76\webapps\grule-manager\WEB-INF\lib\grule-client-2.0.2.RELEASE.jar!\com\gillion\grule\client\components\RemoteServiceComponent.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */
